using Godot;
using System;
using System.IO;

public partial class ItemTile : MarginContainer
{
	public TextureRect _textureRect;
	private Label _label;
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
		_textureRect = GetNode<TextureRect>("TextureRect");
		_label = GetNode<Label>("Label");
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public override void _Process(double delta)
	{
	}
	public void update_display(Item item)
	{
		_textureRect.Texture = item.texture;
		if(item.max_stack<=1)
		{
			_label.Hide();
		}
		else
		{
			_label.Show();
			var number = item.quantity;
			_label.Text = number.ToString();
		}
	}

	
}
